const http = require('http')
const fs = require('fs')
http
  .createServer(function(request, response) {
    if (request.url) {
      const body = fs.readFileSync('./index.html')
      response.writeHead(200, {
        'Content-Type': 'text/html',
        'Set-Cookie': ['name=jtr; max-age=2', 'pwd=1234567;httpOnly']
      })
      response.end(body)
    }
  })
  .listen(8888)

console.log('server at 8888')
